/**
 * Created by Puton on 2019/10/29.
 */


/**
 * 表格数据格式化
 */
(function (window) {
    let font_label_size = 10;

    let pie_color = [
        '#00B8FC',
        '#FF7F2C',
        '#00EAD0',
        '#FF2947',
        '#814EFA',
        '#EE30A7',
        '#A0522D',
        '#008B8B',
        '#32CD32',
        '#474747',
        '#DCFD00',
    ];

    let line_color = [
        '#00B8FC',
        '#FF7F2C',
        '#00EAD0',
        '#FF2947',
        '#814EFA',
        '#EE30A7',
        '#A0522D',
        '#008B8B',
        '#32CD32',
        '#474747',
        '#DCFD00',
    ];

    let bar_color = [
        '#00B8FC',
        '#FF7F2C',
        '#00EAD0',
        '#FF2947',
        '#814EFA',
        '#EE30A7',
        '#A0522D',
        '#008B8B',
        '#32CD32',
        '#474747',
        '#DCFD00',
    ];

    //定义表格formatter返回的变量
    let barMaxWidth = 50;
    let titleFontSize = 15;
    //折线图
    function line(data, xAxisName, is_black){
        var title = data.title;
        var legend = data.legend;
        var xAxis = data.xAxis;
        var series = data.series;
        var seriesLength = series.length;
        // itemStyle : { normal: {label : {show: true}}}
        for (var i =0; i < seriesLength; i++){
            series[i]['label'] = is_black ? {
                show: true,
                position: 'top',
                textStyle: {
                    //color: '#000',
                }
            }: {
                show: true,
                position: 'top',
                textStyle: {
                    color: '#000',
                }
            };
        }

        //计算 selected  ，，默认全部不选中
        var selected_data = {};
        for (var i=0;i<legend.length;i++){
            if(i === 0){
                selected_data[legend[i]] = true;
            }else{
                selected_data[legend[i]] = false;
            }

            selected_data['icon'] = 'rect';
        }

        // 图例修改形状，及文字的位置
        var legend_icon_data = [];
        for (var i=0;i<legend.length;i++){

            legend_icon_data.push({
                name:legend[i],
                textStyle:{
                    fontSize: 12,
                    align:'center',
                    //padding: [
                    //       上,右,下,左
                    padding:[0,5,-3,-5]
                },
                // icon:'circle'

            });
        }

        var option = {
            color:line_color,
            title: {
                text: title['text'].toUpperCase(),
                textStyle: {
                    fontSize: titleFontSize,
                },
            },
            // tooltip: {
            //     trigger: 'axis'
            // },
            legend: {
                data:legend_icon_data,
                // selected:selected_data,
                type: 'scroll',
                itemWidth:13,
                itemHeight:13,
                textStyle:{
                    fontSize: 11,
                    fontStyle: 'normal',
                    fontWeight: 'normal',
                },
                // icon:'pin',
                top:'8%',
                left:'15%',
                right:'15%',
            },
            grid: {
                top: '20%',
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
            },

            xAxis: {
                //name: xAxisName,
                type: 'category',
                boundaryGap: [0, 1],
                data: xAxis
            },
            yAxis: {
                name : '人数',
                type: 'value',
                boundaryGap: [0, 0.1],
                minInterval : 1,
            },
            series: series
        };

        return option;
    }

    //折线图
    function sn_line(data, xAxisName, is_black){
        var title = data.title;
        var legend = data.legend;
        var xAxis = data.xAxis;
        var series = data.series;
        var seriesLength = series.length;
        // itemStyle : { normal: {label : {show: true}}}
        for (var i =0; i < seriesLength; i++){
            series[i]['label'] = is_black ? {
                show: true,
                position: 'top',
                textStyle: {
                    //color: '#000',
                }
            }: {
                show: true,
                position: 'top',
                textStyle: {
                    color: '#000',
                }
            };

            //格式化 数据显示
            var dataLength = series[i]['data'].length;
            for (var j =0; j < dataLength; j++){
                if(series[i]['data'][j] == -1 || series[i]['data'][j] == -2){
                    series[i]['data'][j] = 0;
                }
            }

        }

        //计算 selected  ，，默认全部不选中
        var selected_data = {};
        for (var i=0;i<legend.length;i++){
            if(i === 0){
                selected_data[legend[i]] = true;
            }else{
                selected_data[legend[i]] = false;
            }

            selected_data['icon'] = 'rect';
        }

        // 图例修改形状，及文字的位置
        var legend_icon_data = [];
        for (var i=0;i<legend.length;i++){

            legend_icon_data.push({
                name:legend[i],
                textStyle:{
                    fontSize: 12,
                    align:'center',
                    //padding: [
                    //       上,右,下,左
                    padding:[0,5,-3,-5]
                },
                // icon:'circle'

            });
        }

        var xAxisNameNow = [];
        if(xAxisName == 'WEEK' ){
            var xAxisLength = xAxis.length;
            for (var i=0; i < xAxisLength; i++){
                var week_number = xAxis[i].substr(2,2);
                if(week_number == '01'){
                    // xAxisNameNow.push('WK.01(20'+ xAxis[i].substr(0,2) +')');
                    xAxisNameNow.push('WK.01('+ xAxis[i].substr(0,2) +')');
                }else {
                    xAxisNameNow.push('WK.'+week_number);
                }
            }
            xAxis = xAxisNameNow;
        }

        var option = {
            color:line_color,
            title: {
                text: title['text'].toUpperCase(),
                textStyle: {
                    fontSize: titleFontSize,
                },
            },
            // tooltip: {
            //     trigger: 'axis'
            // },
            legend: {
                data:legend_icon_data,
                selected:selected_data,
                type: 'scroll',
                itemWidth:13,
                itemHeight:13,
                textStyle:{
                    fontSize: 11,
                    fontStyle: 'normal',
                    fontWeight: 'normal',
                },
                // icon:'pin',
                top:'8%',
                left:'15%',
                right:'15%',
            },
            grid: {
                top: '20%',
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
            },

            xAxis: {
                //name: xAxisName,
                type: 'category',
                boundaryGap: [0, 1],
                axisLabel: {
                    interval:0,
                    rotate:30
                },
                data: xAxis
            },
            yAxis: {
                name : '个',
                type: 'value',
                boundaryGap: [0, 0.1],
                minInterval : 1,
            },
            series: series
        };

        return option;
    }

    //折线图
    function per_line(data, xAxisName, is_black){
        var title = data.title;
        var legend = data.legend;
        var xAxis = data.xAxis;
        var series = data.series;
        var seriesLength = series.length;
        // itemStyle : { normal: {label : {show: true}}}
        for (var i =0; i < seriesLength; i++){
            series[i]['label'] = is_black ? {
                show: true,
                position: 'top',
                textStyle: {
                    //color: '#000',
                },
                formatter: '{c} %'
            }: {
                show: true,
                position: 'top',
                textStyle: {
                    color: '#000',
                },
                formatter: '{c} %'
            };

            //格式化 数据显示
            var dataLength = series[i]['data'].length;
            for (var j =0; j < dataLength; j++){
                if(series[i]['data'][j] == -1 || series[i]['data'][j] == -2){
                    series[i]['data'][j] = 0;
                }
            }

        }

        //计算 selected  ，，默认全部不选中
        var selected_data = {};
        for (var i=0;i<legend.length;i++){
            if(i === 0){
                selected_data[legend[i]] = true;
            }else{
                selected_data[legend[i]] = false;
            }

            selected_data['icon'] = 'rect';
        }

        // 图例修改形状，及文字的位置
        var legend_icon_data = [];
        for (var i=0;i<legend.length;i++){

            legend_icon_data.push({
                name:legend[i],
                textStyle:{
                    fontSize: 12,
                    align:'center',
                    //padding: [
                    //       上,右,下,左
                    padding:[0,5,-3,-5]
                },
                // icon:'circle'

            });
        }

        var xAxisNameNow = [];
        if(xAxisName == 'WEEK' ){
            var xAxisLength = xAxis.length;
            for (var i=0; i < xAxisLength; i++){
                var week_number = xAxis[i].toString().substr(2,2);
                if(week_number == '01'){
                    // xAxisNameNow.push('WK.01(20'+ xAxis[i].substr(0,2) +')');
                    xAxisNameNow.push('WK.01('+ xAxis[i].substr(0,2) +')');
                }else {
                    xAxisNameNow.push('WK.'+week_number);
                }
            }
            xAxis = xAxisNameNow;
        }

        var option = {
            color:line_color,
            title: {
                text: title['text'].toUpperCase(),
                textStyle: {
                    fontSize: titleFontSize,
                },
            },
            legend: {
                data:legend_icon_data,
                selected:selected_data,
                type: 'scroll',
                itemWidth:13,
                itemHeight:13,
                textStyle:{
                    fontSize: 11,
                    fontStyle: 'normal',
                    fontWeight: 'normal',
                },
                // icon:'pin',
                top:'8%',
                left:'15%',
                right:'15%',
            },
            grid: {
                top: '20%',
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
            },
            xAxis: {
                //name: xAxisName,
                type: 'category',
                boundaryGap: [0, 1],
                data: xAxis,
            },
            yAxis: {
                name : '百分比',
                type: 'value',
                boundaryGap: [0, 0.1],
                axisLabel: {
                    formatter: '{value} %'
                }
            },
            series: series
        };

        return option;
    }

    //一张图上 两个分开的折线图
    function two_line(data,xAxisName) {
        var title = data.title;
        var legend = data.legend;
        var xAxis = data.xAxis;
        var series = data.series;


        var xAxisNameNow = [];
        if(xAxisName == 'WEEK' ){
            var xAxisLength = xAxis.length;
            for (var i=0; i < xAxisLength; i++){
                var week_number = xAxis[i].substr(2,2);
                if(week_number == '01'){
                    // xAxisNameNow.push('WK.01(20'+ xAxis[i].substr(0,2) +')');
                    xAxisNameNow.push('WK.01('+ xAxis[i].substr(0,2) +')');
                }else {
                    xAxisNameNow.push('WK.'+week_number);
                }
            }
            xAxis = xAxisNameNow;
        }

        var seriesLength = series.length;
        // itemStyle : { normal: {label : {show: true}}}
        for (var i =0; i < seriesLength; i++){
            series[i]['itemStyle'] = {
                normal: {
                    label : {
                        show: true,
                        position: 'top',
                        textStyle: {
                            color: '#000',
                        }
                    }
                }
            };

            //格式化 数据显示
            var dataLength = series[i]['data'].length;
            for (var j =0; j < dataLength; j++){
                if(series[i]['data'][j] == -1 || series[i]['data'][j] == -2){
                    series[i]['data'][j] = 0;
                }
            }

        }

        var option = {
            color:line_color,
            title: [
                {
                    text: title['text'][0].toUpperCase(),
                    'top':'4%',
                    'left':'left',
                    textStyle: {
                        fontSize: titleFontSize,
                    },
                },
                {
                    text: title['text'][1].toUpperCase(),
                    'top':'50%',
                    'left':'left',
                    textStyle: {
                        fontSize: titleFontSize,
                    },
                }
            ],
            // tooltip: {
            //     trigger: 'axis'
            // },
 
            xAxis: [{
                //name: xAxisName,
                data: xAxis,
                axisLabel: {
                    interval:0,
                    rotate:40
                }
            }, {
                //name: xAxisName,
                data: xAxis,
                gridIndex: 1,
                axisLabel: {
                    interval:0,
                    rotate:40
                },
            }],
            yAxis: [{
                name : 'DPPM',
                splitLine: {show: false},
                boundaryGap: [0, 0.1],
                minInterval : 50,
            }, {
                name : 'DPPM',
                splitLine: {show: false},
                gridIndex: 1,
                boundaryGap: [0, 0.1],
                minInterval : 1,
            }],
            grid: [{
                bottom: '50%',
                left: '3%',
                right: '4%',
                containLabel: true
            }, {
                top: '65%',
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
            }],
            series: series
        };
        return option;
    }

    //柱状图组
    function bar_arr(data){
        var title = data.title;
        var legend = data.legend;
        var xAxis = data.xAxis;
        var series = data.series;
        var seriesLength = series.length;
        // itemStyle : { normal: {label : {show: true}}}
        for (var i =0; i < seriesLength; i++){
            series[i]['label'] = {
                show: true,
                position: 'top',
                textStyle: {
                    color: '#000',
                }
            };
        }

        //计算 selected  ，，默认全部不选中
        var selected_data = {};
        for (var i=0;i<legend.length;i++){
            if(i === 0){
                selected_data[legend[i]] = true;
            }else{
                selected_data[legend[i]] = true;
            }

            selected_data['icon'] = 'rect';
        }

        // 图例修改形状，及文字的位置
        var legend_icon_data = [];
        for (var i=0;i<legend.length;i++){

            legend_icon_data.push({
                name:legend[i],
                textStyle:{
                    fontSize: 12,
                    align:'center',
                    //padding: [
                    //       上,右,下,左
                    padding:[0,5,-3,-5]
                },
                // icon:'circle'

            });
        }


        var option = {
            color:bar_color,
            title: {
                text: title['text'].toUpperCase(),
                textStyle: {
                    fontSize: titleFontSize,
                },
            },
            // tooltip: {
            //     trigger: 'axis'
            // },
            legend: {
                data:legend_icon_data,
                selected:selected_data,
                type: 'scroll',
                itemWidth:13,
                itemHeight:13,
                textStyle:{
                    fontSize: 11,
                    fontStyle: 'normal',
                    fontWeight: 'normal',
                },
                // icon:'pin',
                top:'8%',
                left:'15%',
                right:'15%',
            },
            grid: {
                left: '3%',
                right: '4%',
                bottom: '5%',
                containLabel: true
            },
  
            xAxis: [
                {
                    type: 'category',
                    boundaryGap: [0, 1],
                    data: xAxis
                }
            ],
            yAxis: [
                {
                    name : 'DPPM',
                    type: 'value',
                    boundaryGap: [0, 0.1],
                    minInterval : 50,
                },
            ],
            series: series
        };

        return option;
    }

    //柱状图组
    function bar(data){
        var title = data.title;
        var legend = data.legend;
        var xAxis = data.xAxis;
        var series = data.series;

        var option = {
            color:bar_color,
            title: {
                text: title['text'].toUpperCase(),
                textStyle: {
                    fontSize: titleFontSize,
                },
            },
            // tooltip: {
            //     trigger: 'axis'
            // },
            legend: {
                data:legend,
                icon:'circle',
            },
            grid: {
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
            },
  
            xAxis: [
                {
                    //name: xAxisName,
                    type: 'category',
                    boundaryGap: [0, 1],
                    axisLabel: {
                        // interval:0,
                        // rotate:40
                    },
                    data: xAxis
                }
            ],
            yAxis: [
                {
                    name : '人数',
                    type: 'value',
                    boundaryGap: [0, 0.1],
                    minInterval : 1,
                }
            ],
            series: [
                {
                    name:'人数',
                    type:'bar',
                    barMaxWidth: barMaxWidth,
                    data:series['data'],
                    itemStyle: {
                        normal: {
                            label: {
                                show: true, //开启显示
                                // position: 'top', //在上方显示
                                // textStyle: { //数值样式
                                //     color: 'black',
                                //     fontSize: 12
                                // }
                            }
                        }
                    },
                }
            ]
        };

        return option;
    }

    //折线图
    function staff_line(data,minInterval,y_name,xAxisName){
        var title = data.title;
        var legend = data.legend;
        var xAxis = data.xAxis;
        var series = data.series;
        var seriesLength = series.length;
        // itemStyle : { normal: {label : {show: true}}}
        for (var i =0; i < seriesLength; i++){
            series[i]['label'] = {
                show: true,
                position: 'top',
                textStyle: {
                    color: '#000',
                }
            };

            //格式化 数据显示
            var dataLength = series[i]['data'].length;
            for (var j =0; j < dataLength; j++){
                if(series[i]['data'][j] == -1 || series[i]['data'][j] == -2){
                    series[i]['data'][j] = 0;
                }
            }
        }

        //计算 selected  ，，默认全部不选中
        var selected_data = {};
        for (var i=0;i<legend.length;i++){
            if(i === 0){
                selected_data[legend[i]] = true;
            }else{
                selected_data[legend[i]] = true;
            }

            selected_data['icon'] = 'rect';
        }

        // 图例修改形状，及文字的位置
        var legend_icon_data = [];
        for (var i=0;i<legend.length;i++){

            legend_icon_data.push({
                name:legend[i],
                textStyle:{
                    fontSize: 12,
                    align:'center',
                    //padding: [
                    //       上,右,下,左
                    padding:[0,5,-3,-5]
                },
                // icon:'circle'

            });
        }

        var xAxisNameNow = [];
        if(xAxisName == 'WEEK' ){
            var xAxisLength = xAxis.length;
            for (var i=0; i < xAxisLength; i++){
                var week_number = xAxis[i].substr(2,2);
                if(week_number == '01'){
                    // xAxisNameNow.push('WK.01(20'+ xAxis[i].substr(0,2) +')');
                    xAxisNameNow.push('WK.01('+ xAxis[i].substr(0,2) +')');
                }else {
                    xAxisNameNow.push('WK.'+week_number);
                }
            }
            xAxis = xAxisNameNow;
        }

        var option = {
            color:line_color,
            title: {
                text: title['text'].toUpperCase(),
                textStyle: {
                    fontSize: titleFontSize,
                },
            },
            // tooltip: {
            //     trigger: 'axis'
            // },
            legend: {
                data:legend_icon_data,
                selected:selected_data,
                type: 'scroll',
                itemWidth:13,
                itemHeight:13,
                textStyle:{
                    fontSize: 11,
                    fontStyle: 'normal',
                    fontWeight: 'normal',
                },
                // icon:'pin',
                top:'8%',
                left:'15%',
                right:'15%',
            },
            grid: {
                top: '20%',
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
            },

            xAxis: {
                //name: xAxisName,
                type: 'category',
                boundaryGap: [0, 1],
                data: xAxis
            },
            yAxis: {
                name : y_name ? y_name :'DPPM',
                type: 'value',
                boundaryGap: [0, 0.1],
                minInterval : minInterval,
            },
            series: series
        };

        return option;
    }

    //柱状图组
    function staff_bar_arr(data){
        var title = data.title;
        var legend = data.legend;
        var xAxis = data.xAxis;
        var series = data.series;
        var seriesLength = series.length;
        // itemStyle : { normal: {label : {show: true}}}
        for (var i =0; i < seriesLength; i++){
            series[i]['label'] = {
                show: true,
                // position: 'top',
                // textStyle: {
                //     color: '#000',
                // }
            };
            // series[i]['itemStyle'] = {
            //     //通常情况下：
            //     normal: {
            //         //每个柱子的颜色即为colorList数组里的每一项，如果柱子数目多于colorList的长度，则柱子颜色循环使用该数组
            //         color: function (params) {
            //             return bar_color[params.dataIndex];
            //         }
            //     },
            //     //鼠标悬停时：
            //     emphasis: {
            //         shadowBlur: 10,
            //         shadowOffsetX: 0,
            //         shadowColor: 'rgba(0, 0, 0, 0.5)'
            //     },
            //
            // };
            series[i]['barMaxWidth'] = barMaxWidth;
        }

        //计算 selected  ，，默认全部不选中
        var selected_data = {};
        for (var i=0;i<legend.length;i++){
            if(i === 0){
                selected_data[legend[i]] = true;
            }else{
                selected_data[legend[i]] = true;
            }

            selected_data['icon'] = 'rect';
        }

        // 图例修改形状，及文字的位置
        var legend_icon_data = [];
        for (var i=0;i<legend.length;i++){

            legend_icon_data.push({
                name:legend[i],
                textStyle:{
                    fontSize: 12,
                    align:'center',
                    //padding: [
                    //       上,右,下,左
                    padding:[0,5,-3,-5]
                },
                // icon:'circle'

            });
        }


        var option = {
            color:bar_color,
            title: {
                text: title['text'].toUpperCase(),
                textStyle: {
                    fontSize: titleFontSize,
                },
            },
            // tooltip: {
            //     trigger: 'axis'
            // },
            legend: {
                data:legend_icon_data,
                selected:selected_data,
                type: 'scroll',
                itemWidth:13,
                itemHeight:13,
                textStyle:{
                    fontSize: 11,
                    fontStyle: 'normal',
                    fontWeight: 'normal',
                },
                // icon:'pin',
                top:'8%',
                left:'15%',
                right:'15%',
            },
            grid: {
                left: '3%',
                right: '4%',
                bottom: '5%',
                containLabel: true
            },

            xAxis: [
                {
                    type: 'category',
                    boundaryGap: [0, 1],
                    data: xAxis,
                    axisLabel: {
                        // interval:0,
                        // rotate:40,

                        formatter:function(value){
                            var str = "";
                            var num = 8; //每行显示字数
                            var valLength = value.length; //该项x轴字数
                            var rowNum = Math.ceil(valLength / num); // 行数

                            if(rowNum > 1) {
                                for(var i = 0; i < rowNum; i++) {
                                    var temp = "";
                                    var start = i * num;
                                    var end = start + num;

                                    temp = value.substring(start, end) + "\n";
                                    str += temp;
                                }
                                return str;
                            } else {
                                return value;
                            }
                        }
                    },
                }
            ],
            yAxis: [
                {
                    name : '人数',
                    type: 'value',
                    boundaryGap: [0, 0.1],
                    minInterval : 1,
                },
            ],
            series: series
        };

        return option;
    }

    //柱状图组
    function staff_bar(data){
        var title = data.title;
        var legend = data.legend;
        var xAxis = data.xAxis;
        var series = data.series;
        var option = {
            color:bar_color,
            title: {
                text: title['text'].toUpperCase(),
                textStyle: {
                    fontSize: titleFontSize,
                },
            },
            // tooltip: {
            //     trigger: 'axis'
            // },
            legend: {
                data:legend,
                icon:'circle',
            },
            grid: {
                left: '3%',
                right: '8%',
                bottom: '3%',
                containLabel: true
            },

            xAxis: [
                {
                    type: 'category',
                    boundaryGap: [0, 1],
                    axisLabel: {
                        interval:0,
                        rotate:40
                    },
                    data: xAxis
                }
            ],
            yAxis: [
                {
                    name : 'DPPM',
                    type: 'value',
                    boundaryGap: [0, 0.1],
                    minInterval : 50,
                }
            ],
            series: [
                {
                    name:'DPPM',
                    type:'bar',
                    barMaxWidth: barMaxWidth,
                    data:series['data'],
                    itemStyle: {
                        normal: {
                            label: {
                                show: true, //开启显示
                                // position: 'top', //在上方显示
                                // textStyle: { //数值样式
                                //     color: 'black',
                                //     fontSize: 12
                                // }
                            }
                        }
                    },
                }
            ]
        };

        return option;
    }


    //柱状图 横向的
    function bar_across(data, color){
        var title = data.title;
        var legend = data.legend;
        var xAxis = data.xAxis;
        var series = data.series;
        var option = {
            color: color ? bar_color[color] : bar_color,
            title: {
                text: title['text'].toUpperCase(),
                textStyle: {
                    fontSize: titleFontSize,
                },
            },
            // tooltip: {
            //     trigger: 'axis'
            // },
            legend: {
                data:legend,
                icon:'circle',
            },
            grid: {
                left: '5%',
                right: '8%',
                bottom: '3%',
                containLabel: true
            },

            xAxis: [{
                show: true,
                type: 'value',
                position: 'insideBottom',
                "axisLine":{       //y轴
                    "show":false

                },
                "axisTick":{       //y轴刻度线
                    "show":false
                },
                "splitLine": {     //网格线
                    "show": false
                },
            },
                {
                    show: false,
                }
            ],
            yAxis: {
                name : 'DPPM',
                type: 'category',
                // inverse: true,
                // show: false
                boundaryGap: [0, 0.1],
                minInterval : 50,
            },

            series: [
                //亮色条 百分比
                {
                    show: true,
                    type: 'bar',
                    barGap: '-100%',
                    barMaxWidth: barMaxWidth-20,
                    barWidth: 20,
                    z: 2,
                    label: {
                        normal: {
                            show: true,
                            // textStyle: {
                            //     color: 'black',
                            //     fontSize: 12,
                            //     // fontWeight: 'bold'
                            // },
                            // position: 'right',
                            // formatter: function(data) {
                            //     return (series['data'][data.dataIndex]).toFixed(2) + '%';
                            // }
                        }
                    },
                    data: series['data'],
                },
                //年份
                {
                    show: true,
                    type: 'bar',
                    xAxisIndex: 1, //代表使用第二个X轴刻度
                    barGap: '-50%',
                    barWidth: '10%',
                    itemStyle: {
                        normal: {
                            barBorderRadius: 200,
                            color: 'transparent'
                        }
                    },
                    label: {
                        normal: {
                            show: true,
                            position: [5, '-20'],
                            textStyle: {
                                fontSize:10,
                                color: '#333',
                                left: -50,

                            },
                            formatter: function(data) {
                                return xAxis[data.dataIndex];
                            }
                        }
                    },
                    data: series['data']
                }
            ]
        };

        return option;
    }

    //3条折线+饼 图
    function line_pie(data) {
        var title = data['title'];
        var option = {
            color:line_color,
            title: {
                text: title['text'].toUpperCase(),
                textStyle: {
                    fontSize: titleFontSize,
                },
            },
            legend: {},
            // tooltip: {
            //     trigger: 'axis',
            //     showContent: false
            // },
            dataset: {
                source: data['source']
            },
    
            xAxis: {type: 'category'},
            yAxis: {
                name : 'DPPM',
                gridIndex: 0
            },
            grid: {top: '55%'},
            series: [
                {
                    type: 'line',
                    smooth: false,
                    seriesLayoutBy: 'row',
                    itemStyle:{
                        normal: {
                            label : {
                                show: true
                            }
                        }
                    }},
                {
                    type: 'line',
                    smooth: false,
                    seriesLayoutBy: 'row',
                    itemStyle:{
                        normal: {
                            label : {
                                show: true
                            }
                        }
                    }},
                {
                    type: 'line',
                    smooth: false,
                    seriesLayoutBy: 'row',
                    itemStyle:{
                        normal: {
                            label : {
                                show: true
                            }
                        }
                    }},
                {
                    type: 'pie',
                    id: 'pie',
                    radius: '30%',
                    center: ['50%', '25%'],
                    label: {
                        formatter: '{b}: {@'+ data['source'][0][1] +'} ({d}%)'
                    },
                    encode: {
                        itemName: data['source'][0][0],
                        value: data['source'][0][1],
                        tooltip: data['source'][0][1]
                    }
                }
            ]
        };
        return option;
    }

    function pie_two(data, color) {
        var option = {
            color: color ? bar_color[color] : bar_color,
            title: {
                text: data.title['text'].toUpperCase(),
                textStyle: {
                    fontSize: titleFontSize,
                },
                //       上,右,下,左
                padding:[10, 0, 0, 10],
            },
            grid:{
                top:0
            },
            series: [{
                type: 'pie',
                //两个表示环
                radius: ['40%', '60%'],
                center: ['50%', '60%'],
                label: {
                    normal: {
                        formatter: function(params){
                            var str = '';
                            switch(params.name){
                                case params.data.name : str = '{nameStyle|'+params.data.name + ' ' + params.data.value +'}';break;
                            }
                            return str
                        },
                        padding: [0, -80],
                        height: 165,
                        rich: {
                            nameStyle: {
                                fontSize: font_label_size,
                                width:70,
                                height:150,
                                color: "#555",
                                align: 'center'
                            }
                        }
                    }
                },
                labelLine: {
                    normal: {
                        show: true,
                        length: 10,
                        length2: 70,
                        lineStyle: {
                            color: '#d3d3d3'
                        },
                        align: 'right'
                    },
                    color: "#000",
                    emphasis: {
                        show: true
                    }
                },
                data:data.series,
                itemStyle: {
                    emphasis: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                    }
                }
            }]
        };
        return option;
    }

    function pie_solid(data) {
        var option = {
            color:pie_color,
            title: {
                text: data.title['text'].toUpperCase(),
                textStyle: {
                    fontSize: titleFontSize,
                },
                //       上,右,下,左
                padding:[10, 0, 0, 10],
            },
            grid:{
                top:0
            },
            series: [{
                type: 'pie',
                //两个表示环
                radius: ['10%', '40%'],
                center: ['50%', '50%'],
                label: {
                    normal: {
                        formatter: function(params){
                            var str = '';
                            switch(params.name){
                                case params.data.name : str = '{nameStyle|'+params.data.name + ' ' + params.data.value +'}';break;
                            }
                            return str
                        },
                        padding: [0, -80],
                        height: 165,
                        rich: {
                            nameStyle: {
                                fontSize: font_label_size,
                                width:70,
                                height:150,
                                color: "#555",
                                align: 'center'
                            }
                        }
                    }
                },
                labelLine: {
                    normal: {
                        show: true,
                        length: 10,
                        length2: 70,
                        lineStyle: {
                            color: '#d3d3d3'
                        },
                        align: 'right'
                    },
                    color: "#000",
                    emphasis: {
                        show: true
                    }
                },
                data:data.series,
                itemStyle: {
                    emphasis: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                    }
                }
            }]
        };
        return option;
    }

    function land_line(data, xAxisName,) {
        var title = data.title;
        var xAxis = data.xAxis;
        var series = data.series;

        //格式化 数据显示
        var dataLength = series.length;
        for (var j =0; j < dataLength; j++){
            if(series[j] == -1 || series[j] == -2){
                series[j] = 0;
            }
        }

        var xAxisNameNow = [];
        if(xAxisName == 'WEEK' ){
            var xAxisLength = xAxis.length;
            for (var i=0; i < xAxisLength; i++){
                 var week_number = xAxis[i].substr(2,2);
                if(week_number == '01'){
                    // xAxisNameNow.push('WK.01(20'+ xAxis[i].substr(0,2) +')');
                    xAxisNameNow.push('WK.01('+ xAxis[i].substr(0,2) +')');
                }else {
                    xAxisNameNow.push('WK.'+week_number);
                }
            }
            xAxis = xAxisNameNow;
        }

        var option = {
            title: {
                text: title['text'],
                x:'50%',
                y:'-1%',
                textAlign:'center',
                textStyle: {
                    fontSize: 18 // 用 legend.textStyle.fontSize 更改示例大小
                },
                top:2,
            },
            legend: {
                itemWidth:5,
                itemHeight:5,
                top:'8%',
            },
            dataset: {
                source: [
                    xAxis,
                    series,
                ]
            },
            xAxis: {
                //name: xAxisName,
                type: 'category'
            },
            yAxis: [
                {
                    name : 'DPPM',
                    type: 'value',
                    boundaryGap: [0, 0.1],
                    minInterval : 50,
                    splitLine:{
                        show:false
                    },
                }
            ],
            grid: {
                left: '3%',
                right: '4%',
                bottom: '16%',
                top:'25%',
                containLabel: true
            },
            series: [
                {
                    type: 'line',
                    // symbol: 'diamond',
                    // symbolSize: 15,
                    seriesLayoutBy: 'row',
                    label: {
                        show: true,
                        position: 'top',
                        // textStyle: {
                        //     color: '#000',
                        // }
                    },
                    lineStyle: {
                        normal: {
                            color: line_color[0], // 线条颜色
                        },
                    },

                    itemStyle: {
                        color: line_color[0], // 线条颜色
                        // borderWidth: 5
                    },

                },
            ]
        };

        return option;
    }

    function land_bar3(data, xAxisName) {
        var legend = data.legend;
        var title = data.title;
        var xAxis = data.xAxis;
        var series = data.series;

        var xAxisNameNow = [];
        if(xAxisName == 'WEEK' ){
            var xAxisLength = xAxis.length;
            for (var i=0; i < xAxisLength; i++){
                var week_number = xAxis[i].substr(2,2);
                if(week_number == '01'){
                    // xAxisNameNow.push('WK.01(20'+ xAxis[i].substr(0,2) +')');
                    xAxisNameNow.push('WK.01('+ xAxis[i].substr(0,2) +')');
                }else {
                    xAxisNameNow.push('WK.'+week_number);
                }
            }
            xAxis = xAxisNameNow;
        }

        var option = {
            title:{
                text:title['text'],
                left:'center',
                padding:[0,0,0,0],
                textStyle: {
                    fontSize: 18,
                },
            },
            color: bar_color,
            // tooltip : {
            //     trigger: 'axis',
            //     axisPointer : {            // 坐标轴指示器，坐标轴触发有效
            //         type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
            //     }
            // },
            grid: {
                left: '3%',
                right: '4%',
                bottom: '8%',
                top:'18%',
                containLabel: true
            },
            legend: {
                data:legend,
                icon:'circle',
                top:'7%',
            },
            xAxis : [
                {
                    //name: xAxisName,
                    type : 'category',
                    data : xAxis,
                    axisTick: {
                        alignWithLabel: true
                    }
                }
            ],
            yAxis : [
                {
                    name: 'DPPM',
                    type : 'value',
                    "show" : true,
                    "axisLine":{       //y轴
                        "show":false
                    },
                    "axisTick":{       //y轴刻度线
                        "show":false
                    },
                    "splitLine": {     //网格线
                        "show": false
                    }
                }
            ],
            series : [
                {
                    name: 'Production',
                    type: 'bar',
                    barMaxWidth: barMaxWidth,
                    stack: 'DPPM',
                    label: {
                        normal: {
                            show: true,
                            position: 'inside'
                        }
                    },
                    data: series['production']
                },
                {
                    name: 'Material',
                    type: 'bar',
                    stack: 'DPPM',
                    label: {
                        normal: {
                            show: true,
                            position: 'inside'
                        }
                    },
                    data: series['material']
                },
                {
                    name: 'Design/NTF',
                    type: 'bar',
                    stack: 'DPPM',
                    label: {
                        normal: {
                            show: true,
                            position: 'inside'
                        }
                    },
                    data: series['design_ntf']
                }
            ]
        };

        return option;
    }

    function land_pie(data) {
        var series = data.series;

        var option = {
            color:pie_color,
            grid:{
                top:0
            },
            series: [{
                type: 'pie',
                radius: '60%',
                center: ['50%', '50%'],
                label: {
                    normal: {
                        formatter: function(params){
                            var str = '';
                            switch(params.name){
                                case params.data.name:str = '{nameStyle|'+params.data.name + ' ' + params.data.value +'}';break;
                            }
                            return str
                        },
                        padding: [0, -90],
                        height: 165,
                        rich: {
                            nameStyle: {
                                fontSize: font_label_size,
                                width:75,
                                height:150,
                                color: "#555",
                                align: 'center'
                            }
                        }
                    }
                },
                labelLine: {
                    normal: {
                        show: true,
                        length: 15,
                        length2: 80,
                        lineStyle: {
                            color: '#d3d3d3'
                        },
                        align: 'right'
                    },
                    color: "#000",
                    emphasis: {
                        show: true
                    }
                },
                data:[
                    {value:series['production'], name:'Production'},
                    {value:series['material'], name:'Material'},
                    {value:series['design_ntf'], name:'Design/NTF'},
                ],
                // itemStyle: {
                //     normal: {
                //         color: function(params) {
                //             return pie_color[params.dataIndex]
                //         }
                //     }
                // }
            }]
        };

        return option;
    }

    function land_pie2(data){
        var option = {
            color:pie_color,
            grid:{
                top:'3%'
            },
            series: [{
                type: 'pie',
                //两个表示环
                roseType : 'area',
                radius : [20, 100],
                label: {
                    normal: {
                        formatter: function(params){
                            var str = '';
                            switch(params.name){
                                case params.data.name : str = '{nameStyle|'+params.data.name + ' ' + params.data.value +'}';break;
                            }
                            return str
                        },
                        padding: [0, -80],
                        height: 165,
                        rich: {
                            nameStyle: {
                                fontSize: font_label_size,
                                width:70,
                                height:150,
                                color: "#555",
                                align: 'center'
                            }
                        }
                    }
                },
                labelLine: {
                    normal: {
                        show: true,
                        length: 10,
                        length2: 70,
                        lineStyle: {
                            color: '#d3d3d3'
                        },
                        align: 'right'
                    },
                    color: "#000",
                    emphasis: {
                        show: true
                    }
                },
                data:data.series,
                // itemStyle: {
                //     emphasis: {
                //         shadowBlur: 10,
                //         shadowOffsetX: 0,
                //         shadowColor: 'rgba(0, 0, 0, 0.5)'
                //     }
                // }
            }]
        };
        return option;
    }

    function land_bar(data, color, yAxisName){

        var option = {
            color: color ? bar_color[color] : bar_color,
            dataset: {
                source: data['source']
            },
            grid: {
                top:'15%',
                left: '3%',
                right: '4%',
                bottom: '10%',
                containLabel: true
            },
            xAxis:  {
                name: 'DPPM',
                type: 'value',
                position: 'insideBottom',
                "show" : true,
                "axisLine":{       //y轴
                    "show":false

                },
                "axisTick":{       //y轴刻度线
                    "show":false
                },
                "splitLine": {     //网格线
                    "show": false
                },
            },
            yAxis: {
                //name: yAxisName,
                type: 'category',
                boundaryGap: [0, 0.1],
                minInterval : 50,
            },
            series: [
                {
                    type: 'bar',
                    encode: {
                        // Map the "amount" column to X axis.
                        x: 'amount',
                        // Map the "product" column to Y axis
                        y: 'product'
                    },
                    label: {
                        normal: {
                            show: true,
                            position: 'inside'
                        }
                    },
                    barMaxWidth: barMaxWidth,
                }
            ]
        };
        return option;
    }


    //柱状图组
    function pop_up_bar(data, color){
        var title = data.title;
        var legend = data.legend;
        var xAxis = data.xAxis;
        var series = data.series;

        var option = {
            color: color ? bar_color[color] : bar_color,
            title: {
                text: title['text'].toUpperCase(),
                left:'center',
                textStyle: {
                    fontSize: titleFontSize,
                },
            },
            // tooltip: {
            //     trigger: 'axis'
            // },
            legend: {
                data:legend,
                icon:'circle',
            },
            grid: {
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
            },

            xAxis: [
                {
                    type: 'category',
                    boundaryGap: [0, 1],
                    axisLabel: {
                        interval:0,
                        rotate:30
                    },
                    data: xAxis
                }
            ],
            yAxis: [
                {
                    name : 'DPPM',
                    type: 'value',
                    boundaryGap: [0, 0.1],
                    minInterval : 25,
                }
            ],
            series: [
                {
                    name:'DPPM',
                    type:'bar',
                    barMaxWidth: barMaxWidth,
                    data:series['data'],
                    label: {
                        show: true, //开启显示
                        //position: 'top', //在上方显示
                        // textStyle: { //数值样式
                        //     color: 'black',
                        //     fontSize: 12
                        // }
                    }
                }
            ]
        };

        return option;
    }

    //柱状图组
    function pop_up_lot_bar(data, color){
        var title = data.title;
        var legend = data.legend;
        var xAxis = data.xAxis;
        var series = data.series;

        var option = {
            color: color ? bar_color[color] : bar_color,
            title: {
                text: title['text'].toUpperCase(),
                left:'center',
                textStyle: {
                    fontSize: titleFontSize,
                },
            },
            // tooltip: {
            //     trigger: 'axis'
            // },
            legend: {
                data:legend,
                icon:'circle',
            },
            grid: {
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
            },

            xAxis: [
                {
                    type: 'category',
                    boundaryGap: [0, 1],
                    axisLabel: {
                        interval:0,
                        rotate:30
                    },
                    data: xAxis
                }
            ],
            yAxis: [
                {
                    name : 'Defect Numbers',
                    type: 'value',
                    boundaryGap: [0, 0.1],
                    minInterval : 1,
                    nameTextStyle:{
                        padding:[0, 0, 0, 60]
                    }
                }
            ],
            series: [
                {
                    name:'DPPM',
                    type:'bar',
                    barMaxWidth: barMaxWidth,
                    data:series['data'],
                    label: {
                        show: true, //开启显示
                        //position: 'top', //在上方显示
                        // textStyle: { //数值样式
                        //     color: 'black',
                        //     fontSize: 12
                        // }
                    }
                }
            ]
        };

        return option;
    }

    //柱状图组 Inspect plan的dps的图表
    function pop_up_bar_dps(data, color){
        var title = data.title;
        var yAxis_title = data.yAxis_title;
        var legend = data.legend;
        var xAxis = data.xAxis;
        var series = data.series;
        var option = {
            color: color ? bar_color[color] : bar_color,
            title: {
                text: title['text'].toUpperCase(),
                left:'center',
                textStyle: {
                    fontSize: titleFontSize,
                },
            },
            // tooltip: {
            //     trigger: 'axis'
            // },
            legend: {
                data:legend,
                icon:'circle',
            },
            grid: {
                left: '3%',
                right: '4%',
                bottom: '25px',
                containLabel: true
            },

            xAxis: [
                {
                    type: 'category',
                    boundaryGap: [0, 1],
                    axisLabel: {
                        interval:0,
                        rotate:30
                    },
                    data: xAxis
                }
            ],
            yAxis: [
                {
                    name : yAxis_title['text'],
                    type: 'value',
                    boundaryGap: [0, 0.1],
                    minInterval : 25,
                }
            ],
            series: [
                {
                    name:yAxis_title['text'],
                    type:'bar',
                    barMaxWidth: barMaxWidth,
                    data:series['data'],
                    label: {
                        show: true, //开启显示
                        formatter:function(params){
                            var time = params.data;
                            return time;
                        },
                        position: 'top', //在上方显示
                        textStyle: { //数值样式
                            color: 'black',
                            fontSize: 12
                        }
                    },
                    markLine : {
                        data : [
                            {type : 'average', name: '平均值'}
                        ],
                        precision:1,
                        lineStyle:{
                            color:"red",
                        }
                    }
                }
            ]
        };
        return option;
    }

    //柱状图 横向的
    function pop_up_bar_across(data, color, right='6%'){
        var title = data.title;
        var legend = data.legend;
        var xAxis = data.xAxis;
        var series = data.series;

        var option = {
            color: color ? bar_color[color] : bar_color,
            title: {
                text: title['text'].toUpperCase(),
                left:'center',
                textStyle: {
                    fontSize: titleFontSize,
                },
            },
            // tooltip: {
            //     trigger: 'axis'
            // },
            legend: {
                data:legend,
                icon:'circle',
            },
            grid: {
                top: '12%',
                left: '5%',
                right: '6%',
                bottom: '3%',
                containLabel: true
            },
            xAxis: [{
                show: true,
                type: 'value',
                position: 'insideBottom',
                minInterval : 5,
                "axisLine":{       //y轴
                    "show":false

                },
                "axisTick":{       //y轴刻度线
                    "show":false
                },
                "splitLine": {     //网格线
                    "show": false
                },
            },
                {
                    show: false,
                }
            ],
            yAxis: {
                name : 'DPPM',
                type: 'category',
                // inverse: true,
                // show: false
                boundaryGap: [0, 0.1],
                minInterval : 50,
            },

            series: [
                //亮色条 百分比
                {
                    show: true,
                    type: 'bar',
                    barGap: '-100%',
                    barMaxWidth: barMaxWidth-20,
                    barWidth: 20,
                    z: 2,
                    label: {
                        normal: {
                            show: true,
                            textStyle: {
                                //color: 'black',
                                fontSize: 12,
                                // fontWeight: 'bold'
                            },
                            //position: 'right',
                            // formatter: function(data) {
                            //     return (series['data'][data.dataIndex]).toFixed(2) + '%';
                            // }
                        }
                    },
                    data: series['data'],
                },
                //年份
                {
                    show: true,
                    type: 'bar',
                    xAxisIndex: 1, //代表使用第二个X轴刻度
                    barGap: '-50%',
                    barWidth: '10%',
                    itemStyle: {
                        normal: {
                            barBorderRadius: 200,
                            color: 'transparent'
                        }
                    },
                    label: {
                        normal: {
                            show: true,
                            position: [5, '-20'],
                            textStyle: {
                                fontSize:10,
                                color: '#333',
                                left: -50,

                            },
                            formatter: function(data) {
                                return xAxis[data.dataIndex];
                            }
                        }
                    },
                    data: series['data']
                }
            ]
        };

        return option;
    }

    function pop_up_pie(data) {
        var title = data.title;
        var series = data.series;
        var option = {
            color: pie_color,
            title: {
                text: title['text'].toUpperCase(),
                left:'center',
                textStyle: {
                    fontSize: titleFontSize,
                },
            },
            grid: {
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
            },
            series: [{
                type: 'pie',
                radius: '60%',
                center: ['50%', '50%'],
                selectedMode: 'single',
                label: {
                    normal: {
                        formatter: function(params){
                            var str = '';
                            switch(params.name){
                                case params.data.name:str = '{nameStyle|'+params.data.name + ' ' + params.data.value +'}';break;
                            }
                            return str
                        },
                        padding: [0, -90],
                        height: 165,
                        rich: {
                            nameStyle: {
                                fontSize: font_label_size,
                                width:75,
                                height:150,
                                color: "#555",
                                align: 'center'
                            }
                        }
                    }
                },
                labelLine: {
                    normal: {
                        show: true,
                        length: 15,
                        length2: 80,
                        lineStyle: {
                            color: '#d3d3d3'
                        },
                        align: 'right'
                    },
                    color: "#000",
                    emphasis: {
                        show: true
                    }
                },
                data:[
                    {value:series['production'], name:'Production'},
                    {value:series['material'], name:'Material'},
                    {value:series['design_ntf'], name:'Design/NTF'},
                ],
                // itemStyle: {
                //     normal: {
                //         color: function(params) {
                //             return pie_color[params.dataIndex]
                //         }
                //     }
                // }
            }]
        };

        return option;
    }


    let areaSize = ['90%','90%'];

    function pop_up_page(type,name){
        layer.closeAll();
        var lay1 = layer.open({
            title: '<span style="display:none">1</span>',
            type: 2,
            area: ['100%', '100%'],
            fix: true,
            content: PageConfig.PopUpUrl+'?type='+type+'&name='+encodeURIComponent(name),
            yes:function (ee) {
            }
        });

        //修改 弹窗样式
        $(".layui-layer-close").append('<i style="color:#138496;margin-bottom:10px;" class="fa fa-arrow-circle-left fa-2x"></i>');
        $(".layui-layer-close").removeClass('layui-layer-close');
        $(".layui-layer-close1").removeClass('layui-layer-close1');
        $(".layui-layer-ico").removeClass('layui-layer-ico');
        $(".layui-layer-setwin").css('left','15px');
    }
    function table_pop_up_page(type,name){
        layer.closeAll();
        var lay1 = layer.open({
            title: '<span style="display:none">1</span>',
            type: 2,
            area: ['100%', '100%'],
            fix: true,
            content: PageConfig.TablePopUpUrl+'?type='+type+'&name='+encodeURIComponent(name),
            yes:function (ee) {
            }
        });
        //修改 弹窗样式
        $(".layui-layer-close").append('<i style="color:#138496;margin-bottom:10px;" class="fa fa-arrow-circle-left fa-2x"></i>');
        $(".layui-layer-close").removeClass('layui-layer-close');
        $(".layui-layer-close1").removeClass('layui-layer-close1');
        $(".layui-layer-ico").removeClass('layui-layer-ico');
        $(".layui-layer-setwin").css('left','15px');
    }
    function table_chart_pop_up_page(type,name){
        layer.closeAll();
        var lay1 = layer.open({
            title: '<span style="display:none">1</span>',
            type: 2,
            area: ['100%', '100%'],
            fix: true,
            content: PageConfig.TableChartPopUpUrl+'?type='+type+'&name='+encodeURIComponent(name),
            yes:function (ee) {
            }
        });
        //修改 弹窗样式
        $(".layui-layer-close").append('<i style="color:#138496;margin-bottom:10px;" class="fa fa-arrow-circle-left fa-2x"></i>');
        $(".layui-layer-close").removeClass('layui-layer-close');
        $(".layui-layer-close1").removeClass('layui-layer-close1');
        $(".layui-layer-ico").removeClass('layui-layer-ico');
        $(".layui-layer-setwin").css('left','15px');
    }
    //Inspection Plan中Dps的图表展示
    function table_dps_pop_up_page(number,work_group_id){
        layer.closeAll();
        var lay1 = layer.open({
            title: '<span style="display:none">1</span>',
            type: 2,
            area: ['100%', '100%'],
            fix: true,
            content: PageConfig.TableDpsPopUpUrl+'?number='+number+'&work_group_id='+work_group_id,
            yes:function (ee) {
            }
        });
        //修改 弹窗样式
        $(".layui-layer-close").append('<i style="color:#138496;margin-bottom:10px;" class="fa fa-arrow-circle-left fa-2x"></i>');
        $(".layui-layer-close").removeClass('layui-layer-close');
        $(".layui-layer-close1").removeClass('layui-layer-close1');
        $(".layui-layer-ico").removeClass('layui-layer-ico');
        $(".layui-layer-setwin").css('left','15px');
    }


    function null_data(seriesData, chartParams){

        var val = 0;
        var seriesDataLength = seriesData['series'].length;
        for (var i =0; i < seriesDataLength; i++){
            if(seriesData['series'][i]['name'] == chartParams.seriesName){
                val = seriesData['series'][i]['data'][chartParams.dataIndex];
                break;
            }
        }

        if(val == 0 ){
            layer.msg('No Failure');
            return true;
        }

        if(val == -1 ){
            layer.msg('No Plan');
            return true;
        }

        if(val == -2 ){
            layer.msg('Data not available in system');
            return true;
        }

        return false;
    }
    //输出
    window.oob_option = {
        line:line,
        sn_line:sn_line,
        per_line:per_line,
        two_line:two_line,
        bar_arr:bar_arr,
        bar:bar,
        bar_across:bar_across,
        pie_solid:pie_solid,
        line_pie:line_pie,
        land_line:land_line,
        land_bar3:land_bar3,
        land_pie:land_pie,
        land_pie2:land_pie2,
        land_bar:land_bar,

        staff_line:staff_line,
        staff_bar:staff_bar,
        staff_bar_arr:staff_bar_arr,


        pop_up_bar:pop_up_bar,
        pop_up_lot_bar:pop_up_lot_bar,
        pop_up_bar_across:pop_up_bar_across,
        pop_up_bar_dps:pop_up_bar_dps,
        pop_up_pie:pop_up_pie,
        pop_up_page:pop_up_page,
        table_pop_up_page:table_pop_up_page,
        table_chart_pop_up_page:table_chart_pop_up_page,
        table_dps_pop_up_page:table_dps_pop_up_page,


        null_data:null_data,
    }
})(window);
